package adapter;

import java.util.List;

import com.friehome.app.R;

import model.LTModel;
import model.SearchModel;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;



public class SearchAdapter extends BaseAdapter{

	Context context;
	List<SearchModel> data;
	public SearchAdapter(Context context,List<SearchModel> data) {
		this.context = context;
		this.data = data;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return data.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		if (convertView == null) {
			convertView = LayoutInflater.from(context).inflate(R.layout.item_search, null);
		}
		
		TextView text1 = (TextView) convertView.findViewById(R.id.text1);
		TextView text2 = (TextView) convertView.findViewById(R.id.text2);
		TextView text3 = (TextView) convertView.findViewById(R.id.text3);
		TextView text4 = (TextView) convertView.findViewById(R.id.text4);
		TextView text5 = (TextView) convertView.findViewById(R.id.text5);

		text1.setText(data.get(position).name);
		text2.setText(data.get(position).sex);
		text3.setText(data.get(position).age);
		text4.setText(data.get(position).time);
		text5.setText(data.get(position).remark);
		
		return convertView;
	}

}
